import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AgentMrIncomeVO, AgentMrIncomeForm, AgentMrIncomeQuery } from '@/api/business/agentMrIncome/types';

/**
 * 查询医药代收入记录列表
 * @param query
 * @returns {*}
 */

export const listAgentMrIncome = (query?: AgentMrIncomeQuery): AxiosPromise<AgentMrIncomeVO[]> => {
  return request({
    url: '/business/agentMrIncome/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询医药代收入记录详细
 * @param id
 */
export const getAgentMrIncome = (id: string | number): AxiosPromise<AgentMrIncomeVO> => {
  return request({
    url: '/business/agentMrIncome/' + id,
    method: 'get'
  });
};

/**
 * 新增医药代收入记录
 * @param data
 */
export const addAgentMrIncome = (data: AgentMrIncomeForm) => {
  return request({
    url: '/business/agentMrIncome',
    method: 'post',
    data: data
  });
};

/**
 * 修改医药代收入记录
 * @param data
 */
export const updateAgentMrIncome = (data: AgentMrIncomeForm) => {
  return request({
    url: '/business/agentMrIncome',
    method: 'put',
    data: data
  });
};

/**
 * 删除医药代收入记录
 * @param id
 */
export const delAgentMrIncome = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/agentMrIncome/' + id,
    method: 'delete'
  });
};
